//
//  Header.h
//  Chart
//
//  Created by wu jingxing on 12-7-14.
//  Copyright (c) 2012年 GuangZhouXuanWu. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>

UIKIT_STATIC_INLINE CGPoint CGPointrfMake(CGFloat nX,CGFloat nY)
{
    return CGPointMake(rintf(nX),rintf(nY));
}

UIKIT_STATIC_INLINE CGPoint CGPointrf(CGPoint point)
{
    return CGPointrfMake(point.x,point.y);
}

UIKIT_STATIC_INLINE CGSize CGSizerfMake(CGFloat nWidth,CGFloat nHeight)
{
    return CGSizeMake(rintf(nWidth),rintf(nHeight));
}

UIKIT_STATIC_INLINE CGSize CGSizerf(CGSize size)
{
    return CGSizerfMake(size.width,size.height);
}

UIKIT_STATIC_INLINE CGRect CGRectrfMake(CGFloat nX,CGFloat nY,CGFloat nWidth,CGFloat nHeight)
{
    return CGRectMake(rintf(nX),rintf(nY),rintf(nWidth),rintf(nHeight));
}

UIKIT_STATIC_INLINE CGRect CGRectrf(CGRect rect)
{
    return CGRectrfMake(CGRectGetMinX(rect),CGRectGetMinY(rect),CGRectGetWidth(rect),CGRectGetHeight(rect));
}


UIKIT_STATIC_INLINE CGFloat Radian(CGFloat nDegree)
{
    return nDegree*M_PI/180;
}

@interface CGRectEx : NSObject
{
    CGRect m_rect;
}

@property(nonatomic,assign) CGRect m_rect;
@property(nonatomic,assign) CGFloat m_nL;
@property(nonatomic,assign) CGFloat m_nT;
@property(nonatomic,assign) CGFloat m_nR;
@property(nonatomic,assign) CGFloat m_nB;
@property(nonatomic,assign) CGFloat m_nWidth;
@property(nonatomic,assign) CGFloat m_nHeight;
@property(nonatomic,readonly) CGPoint m_centerpoint;

+(CGRectEx*)InitWithRect:(CGRect)rect;

+(CGRectEx*)InitWithRect:(CGFloat)nX Y:(CGFloat)nY Width:(CGFloat)nWidth Height:(CGFloat)nHeigh;

@end


